﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yugi.Client.Card;

namespace Yugi.Client.DataModel
{
    public class RequestAPI
    {
        private static Queue<ReqestItem> Queue = new Queue<ReqestItem>();
        internal static Yugi.Client.SupervisorModel super;
        public class ReqestItem
        {
            public int ID { get; set; }
            public int Number { get; set; }
            public Common.YMSG Type { get; set; }
            public Common.YMSG Res_Type { get; set; }
            public object AditionData { get; set; }
            public YType Card_Type = YType.Monster;
           
        }
        public static void Push(ReqestItem item)
        {
            Queue.Enqueue(item);
        }
        public static ReqestItem Get()
        {
            return Queue.Peek();
        }
        public static void SendResponse(params object[] answer)
        {
            ReqestItem item = Queue.Dequeue();
            super.SendMessageToServer(item.Res_Type,answer);
        }
    }
}
